//
//  HJGoogleCloudStorage.h
//  GoogleLoginICloud
//
//  Created by lx on 2024/1/6.
//

#import <Foundation/Foundation.h>
#import <GoogleAPIClientForREST/GTLRDrive.h>

NS_ASSUME_NONNULL_BEGIN


@interface HJGoogleCloudStorage : NSObject

@property (nonatomic, strong, readonly, class) GTLRDriveService *driveService;

+ (void)uploadFileAtPath:(NSString *)path progress:(nullable void (^)( unsigned long long numberOfBytesRead, unsigned long long dataLength))uploadProgress completion:(void (^__nullable)(GTLRDrive_File  * _Nullable file, NSError * _Nullable error))completion;
+ (void)downloadFile:(NSString *)fileId toDestinationURL:(NSURL *)destinationURL completion:(void (^__nullable)(NSError * _Nullable error))completion;
+ (void)fetchFile:(NSString *)fileId completion:(void (^__nullable)(GTLRDrive_File * _Nullable file, NSError * _Nullable error))completion;
+ (void)readFile:(NSString *)fileId completion:(void (^__nullable)(NSData * _Nullable fileData, NSError * _Nullable error))completion;

+ (void)fetchFileWithName:(NSString *)name completion:(void (^__nullable)(NSArray <GTLRDrive_File *> * _Nullable files, NSError * _Nullable error))completion;
+ (void)fetchFileListCompletion:(void (^__nullable)(GTLRDrive_FileList * _Nullable files, NSError * _Nullable error))completion;
+ (void)deleteFile:(NSString *)fileId completion:(void (^__nullable)(NSError * _Nullable error))completion;
+ (void)createAFolderWithName:(NSString *)name completion:(void (^__nullable)(GTLRDrive_File * _Nullable file, NSError * _Nullable error))completion;

@end

NS_ASSUME_NONNULL_END
